package cn.netswap.jeegorilla.framework.filter;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

import javax.servlet.*;
import javax.servlet.annotation.WebFilter;
import java.io.IOException;


@WebFilter(urlPatterns = "/*",filterName = "loginFilter")
public class LoginFilter implements Filter {

    Logger log = LoggerFactory.getLogger(LoginFilter.class);

    @Override
    public void init(FilterConfig filterConfig) throws ServletException {
        //初始化loginFilter
//        log.info("初始化loginFilter");
    }

    @Override
    public void doFilter(ServletRequest request, ServletResponse response, FilterChain chain) throws IOException, ServletException {
        //执行doFilter里面的逻辑
//        log.info("doFilter......");
//        log.info("执行doFilter里面的逻辑");
        chain.doFilter(request,response);
    }

    @Override
    public void destroy() {
        //loginFilter销毁
//        log.info("loginFilter销毁");
    }


}
